import json
import utils

names = utils.read_data("translations/names.json")
public = utils.read_data("translations/public.json")

prefixs={
    "":"",
    "Alpha ":"精英",
    "Aberrant ":"畸变",
    "Brute ":"凶恶",
    "Brute X-":"凶恶X",
    "Corrupted ":"腐化",
    "Chibi ":"袖珍",
    "Chibi-":"袖珍",
    "Chibi-Skeletal ":"袖珍骨架",
    "Chibi-Ghost ":"袖珍幽灵",
    "Chibi-Tek ":"袖珍泰克",
    "Tek ":"泰克",
    "X-":"X",
    "Rare X-":"稀有X",
    "R-":"R",
    "Zombie ":"僵尸",
    "Skeletal ":"骨架",
    "Fertilized ":"授精的",
    "Fertilized Aberrant ":"授精的畸变",
    "Fertilized R-":"授精的R",
    "Fertilized X-":"授精的X",
    "Fertilized Tek ":"授精的泰克",
    "Kibble (":"饲料(",
    "Malfunctioned ":"发生故障的",
    "Malfunctioned Tek ":"发生故障的泰克",
    "VR ":"VR",
    "Spirit ":"幽灵",
    "Polar ":"极地",
    "Brick ":"砖头",
    "Ceramic ":"陶瓷",
    "Stone ":"石制",
    "Rock ":"石头",
    "Gravel ":"沙砾",
    "Geopolymer Cement ":"聚合物水泥",
    "Lumber ":"木制",
    "Lumber Glass ":"木制玻璃",
    "Marble ":"大理石",
    "Reinforced Glass ":"加固玻璃"
    }

suffixs={
    "":"",
    " Ghost":"幽灵",
    " Trophy":"战利品",
    " Saddle":"鞍",
    " Tek Saddle":"泰克鞍",
    " Platform Saddle":"平台鞍",
    " Egg":"蛋",
    " Egg)":"蛋)",
    " Statue":"雕像",
    " (Summoned)":"(召唤而出)",
    " (SummonedD)":"(召唤而出)",
    " (Gauntlet)":"(Gauntlet)",
    " (Gauntlet2)":"(Gauntlet2)",
    " (Gauntlet 2)":"(Gauntlet 2)",
    " (Gauntlet) (Large)":"(Gauntlet)(大)",
    " (Gauntlet) (Alpha)":" (Gauntlet)(困难)",
    " (Escort)":"(护卫)",
    " (Retrieve)":"(Retrieve)",
    " (Mashup)":"(Mashup)",
    " (Shmup)":"(Shmup)",
    " (Race)":"(Race)",
    " (Race2)":"(Race2)",
    " (Shmup bot)":"(Shmup bot)",
    " (Lunar)":"(Lunar)",
    " (Alpha)":"(困难)",
    " (Alpha) (The Center)":"(困难)(中心岛)",
    " (Alpha) (Ragnarok)":"(困难)(仙境)",
    " (Alpha) (Valguero)":"(困难)(瓦尔盖罗)",
    " (Beta)":"(中等)",
    " (Beta) (The Center)":"(中等)(中心岛)",
    " (Beta) (Ragnarok)":"(中等)(仙境)",
    " (Beta) (Valguero)":"(中等)(瓦尔盖罗)",
    " (Gamma)":"(简单)",
    " (Gamma) (The Center)":"(简单)(中心岛)",
    " (Gamma) (Ragnarok)":"(简单)(仙境)",
    " (Gamma) (Valguero)":"(简单)(瓦尔盖罗)",
    " (Hunt)":"(Hunt)",
    " (Hunt2)":"(Hunt2)",
    " (Hunt) (Minion)":"(Hunt)(Boss小弟)",
    " (Minion)":"(Boss小弟)",
    " (Alpha Minion)":"(困难boss小弟)",
    " (Beta Minion)":"(中等boss小弟)",
    " (Gamma Minion)":"(简单boss小弟)",
    " Heir (Minion)":"(女皇产下的小弟)",
    " (Valguero)":"(瓦尔盖罗)",
    " (Sport)":"(Sport)",
    " (Underwater)":"(水下)",
    " (Bow)":"(弓)",
    " (Sword)":"(剑)",
    " (Sword, Terminus mission)":"(剑, Terminus mission)",
    " (Spear)":"(矛)",
    " (Tek Grenade)":"(泰克手雷)",
    " (Tek Rifle)":"(泰克步枪)",
    " (Tek Rifle, Star Dolphin mission)":" (泰克步枪, Star Dolphin mission)",
    " (Maze)":"(迷宫)",
    " (Sanctuary)":"(Sanctuary)",
    " (Final Battle)":" (终战)",
    " (Large) (Gauntlet)":"(大)(Gauntlet)",
    " (Large) (Gauntlet2)":"(大)(Gauntlet2)",
    " (Large) (Summoned)":"(大)(召唤而出))",
    " (Valguero)":"(瓦尔盖罗)",
    " (Life Support)":"(Life Support)",
    " (LifeSupport)":"(LifeSupport)",
    " (Life's Labyrinth)":" (Life's Labyrinth)",
    " (Tek Cave)":"(泰克洞穴)",
    " (The Surface)":"(地表)",
    " (Caverns)":"(Caverns)",
    " Pt. Note":"Pt. Note",
    " Nest":"巢穴",
    " Rug":"地毯",
    " (Valguero)":"(瓦尔盖罗)",
    " (Tamed)":"(已驯服)",
    " (Hunt2 Alpha)":"(Hunt2 Alpha)"
}

for name,name_t in names.items():
    for prefix,prefix_t in prefixs.items():
        for suffix,suffix_t in suffixs.items():
            if f"{prefix}{name}{suffix}" in public:
                public[f"{prefix}{name}{suffix}"] = f"{prefix_t}{name_t}{suffix_t}"
                print(f"{prefix}{name}{suffix}","->",f"{prefix_t}{name_t}{suffix_t}")

utils.save_data(public, "translations/public.json")